<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="MvcContrib.FluentHtml.ModelViewPage<Universum.Views.Blogs.BlogShowViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Universum - Show blog posts
</asp:Content>
<asp:Content ID="BreadcrumbsContent" ContentPlaceHolderID="Breadcrumbs" runat="server">
	<%= Html.Breadcrumb().Home().AppendText("Posts from "+ ( Model.Blog.Owner?? "blog")).End() %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<div class="span-22">
		<div class="span-7 ">
			<ul class="blog-menu">
				<h3>
					Your blog options</h3>
				<li>
					<% Html.BeginUserLink<BlogsController>(c => c.Edit()); %>
					Blog details
					<%  Html.EndLink();%>
				</li>
				<% if (Model.Blog != null && Model.Blog.Owner == Html.LoggedInUser().Identity.Name)
	   { %>
				<li>
					<% Html.BeginUserLink<BlogArticleController>(c => c.Create()); %>
					Add new post
					<%  Html.EndLink();%>
				</li>
				<%} %>
			</ul>
			<% Html.RenderPartial("_NavBarUC", Model.NavBarModel); %>
		</div>
		<div class="span-15 last">
			<% if (Model.ArticlesCount == 0)
	  { %>
			<h3>
				You haven't submitted any post yet.</h3>
			<% }
	  else
	  { %>
			<%= Html.Pager<BlogsController>( controller=>controller.Show(0),
		Model.ArticlesPerPage,
		Model.StartIndex, Model.ArticlesCount) %>
			<%} %>
			<% foreach (var item in Model.ArticlesForBlog)
	  { %>
			<div class="span-13">
				<% Html.RenderPartial("EditControls", item); %>
				<div class="span-9">
					<h2>
						<% if (item.Publish > DateTime.Now)
		 {
						%><span style="font-size: small" class="notice">unpublished</span><%
																							  } %>
						<% Html.BeginLink<BlogArticleController>(controller => controller.Show(item.Slug));%>
						<%=item.Title %>
						<% Html.EndLink(); %>
					</h2>
				</div>
				<div class="span-13">
					<%=item.Text %>
				</div>
			</div>
			<% } %>
		</div>
	</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
</asp:Content>
